<!DOCTYPE HTML>
<html>
<head>
<#include "../common/_meta.html">
    <title>推送属性到整个集群</title>
</head>
<body>
<article class="cl pd-20">
    <form class="form form-horizontal" name="form-edit-cluster-attribute" id="form-edit-cluster-attribute">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">集群：</label>
            <div class="formControls col-xs-8 col-sm-9">${cluster!''}</div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">实例：</label>
            <div class="formControls col-xs-8 col-sm-9">${instance!''}</div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="button" onclick="deleteInstance()" value="&nbsp;&nbsp;移除&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

<#include "../common/_footer.html">

<script type="text/javascript">

    function deleteInstance() {
        var cluster = "${cluster!''}";
        var instance = "${instance!''}";
        layer.confirm("确定要移除此ip的push服务么?", {icon: 3, title:'提示'}, function (flag) {
            var index = layer.load(2);
            if (flag) {
                $.ajax({
                    type: "POST",
                    url: "${base}/resource_manage/remove_ip_service",
                    data: {"clusterValue":cluster,"ipValue":instance},
                    dataType: "json",
                    success: function (result) {
                        layer.close(index);
                        if (result.code === 0) {
                            layer.msg("移除成功", {icon:6,time:1000}, function () {layer_close();});
                        } else {
                            layer.alert("移除失败", {icon:5,time:1000}, function () {layer_close();});
                        }
                    },
                    error: function (result) {
                        layer.close(index);
                        layer.msg("内部错误", {icon:5,time:2000}, function () {layer_close();});
                    }
                });
            }
        }, function () {
        });
    }
</script>
</body>
</html>